type LengthOfString<S extends string, Arr extends unknown[] = []> = 
    S extends `${infer R}${infer P}` ? Arr extends [...infer T] ? LengthOfString<P, [unknown, ...T]> : LengthOfString<P, [unknown]> : Arr['length']